<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>KEN CASHIER</title>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="../../../../assets/modular/system/briCashDesk/phonecashier.css">
    <link rel="stylesheet" href="../../../../assets/modular/system/briCashDesk/layer.css">
    <script src="../../../../assets/modular/system/briCashDesk/jquery.min.js"></script>
    <script src="../../../../assets/modular/system/briCashDesk/clipboard.min.v2.js"></script>
    <script src="../../../../assets/common/layui/layui.js"></script>

</head>

<body>
<div class="container">
    <section id="logo" class="header">
        <div class="solpay-logo"></div>
    </section>
    <div class="main">
        <div class="total-amount">
            <div class="amount" style="font-size: 1.1rem">BRI Transfer amount submission page</div>
        </div>
        <div id="phone-layout" hidden="" style="display: none;">
            <div class="container-row input-box-input-box">
                <input id="phone" class="phone" type="number" placeholder="07XXXXXXXX"
                       oninput="if(value.length>10)value=value.slice(0,10)">
            </div>
            <div class="container-row input-prompt-box-title">Please enter a mobile phone account for transfer</div>
            <button class="pay-btn">pay</button>
        </div>
        <div id="order-layout" class="content" hidden="" style="display: block;">
            <div class="caption">
                <div style="font-size: 0.6rem;color:#e76b6b;">Please enter the correct information and amount at the
                    checkout
                    counter
                </div>
            </div>
            <div class="paymethod bank">
                <div class="item accountNameItem">
                    <div class="label">Account Name</div>
                    <div class="input">
                        <input id="accountName" class="accountName" placeholder="Your Name"
                               oninput="if(value.length>10) value=value.slice(0,10)" style="font-size: 1.0rem">
                        <div class="icons copy"><i class="icon icon-list"></i></div>
                    </div>
                </div>
                <div class="item accountNumberItem">
                    <div class="label">Account Number</div>
                    <div class="input">
                        <input id="accountNumber" class="accountNumber" placeholder="Your Number"
                               style="font-size: 1.0rem" oninput="if(value.length>10)value=value.slice(0,10)">
                        <div class="icons copy"><i class="icon icon-list"></i></div>
                    </div>
                </div>
                <div class="item accountMoneyItem">
                    <div class="label">Account Money</div>
                    <div class="input">
                        <input id="accountMoney" class="accountMoney" placeholder="Your Money"
                               style="font-size: 1.0rem" oninput="if(value.length>10)value=value.slice(0,10)">
                        <div class="icons copy"><i class="icon icon-list"></i></div>
                    </div>
                </div>
            </div>
            <div id="refNo-layout" style="margin-top: 50px">
                <div class="container-row input-prompt-box-title">Please fill in the name, account and amount
                    carefully, the system will automatically generate the corresponding amount
                    according to the data you submit, and jump to the confirmation interface.
                </div>
                <button id="refNoBtn" class="ref-no-btn">Submit to the cash register</button>
            </div>
        </div>
    </div>
</div>
<script>

    $(function () {
        $('#refNoBtn').click(function () {
            var accountName = $('#accountName').val();
            if (accountName == '') {
                //layer.msg('accountName is required');
                alert('accountName is required')
                return;
            }
            var accountNumber = $('#accountNumber').val();
            if (accountNumber == '') {
                // layer.msg('accountNumber is required');
                alert('accountNumber is required')
                return;
            }
            var accountMoney = $('#accountMoney').val();
            if (accountMoney == '') {
                // layer.msg('accountMoney is required');
                alert('accountMoney is required')
                return;
            }
            var cdInfo = "";

            $.ajax({
                type: "get",//请求类型
                async: false,
                url: "/cdInfo/getSmallAmount?accountNumber=" + accountNumber + "&accountName=" + accountName + "&accountMoney=" + accountMoney,
                dataType: "json",//返回的数据类型
                success: function (exportData) {
                    console.log(exportData)
                    cdInfo = exportData;
                },
                error: function (edata) {
                    console.log("异常！" + edata.responseJSON.message);
                }
            });

            location.href = "./index2.html?accountName=" + accountName + "&accountNumber=" + accountNumber + "&accountMoney=" + accountMoney+"&id=" + cdInfo.id+"&amountSmall=" + cdInfo.amountSmall;
        });
    })
</script>
</body>

</html>
